package com.ruubypay.miss.miniotest;

import cn.hutool.Hutool;
import org.apache.shardingsphere.driver.api.yaml.YamlShardingSphereDataSourceFactory;
import org.junit.jupiter.api.Test;
import org.springframework.core.io.ClassPathResource;
import cn.hutool.core.lang.Snowflake;
import java.io.File;
import java.io.IOException;
import java.sql.SQLException;

/**
 * @author fj
 * @date 2025/2/25 09:56
 */
public class CreateDataSource {
    @Test
    public void createDataSource() throws SQLException, IOException {
        //创建数据源
        File file = new File("/Users/xupengfei/Documents/01develope/02workspaces/ruubypay/minio-test/minio-test/src/main/resources/database.yaml");
        YamlShardingSphereDataSourceFactory.createDataSource(file);

    }

    @Test
    public void showHutool(){
//        Hutool.printAllUtils();
        Snowflake snowFlake = new Snowflake(1,1);
        System.out.println(snowFlake.nextIdStr());
    }
}
